<%@page import="java.net.URLEncoder"%>
<%@page import="java.util.List"%>
<%@page import="search.OrderSearchData"%>
<%@page import="java.util.Locale"%>
<%@page import="java.text.NumberFormat"%>
<%@page import="models.OrderModel"%>
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="helpers.UrlHelper"%>
<%@page import="java.util.ArrayList"%>
<%
	int totalEmail = (Integer)request.getAttribute("orderCount");
	int orderCount = (Integer)request.getAttribute("orderCount");
	int totalDeliveryEmail = (Integer)request.getAttribute("orderCount");
	int displayMoney = (Integer)request.getAttribute("displayMoney");
	int realMoney = (Integer)request.getAttribute("realMoney");
	int clickCount = (Integer)request.getAttribute("clickCount");	
	String fromDate = "";
	String toDate = "";	
	if(request.getAttribute("fromDate")!=null&&!request.getAttribute("fromDate").toString().isEmpty()){
		fromDate = (String)request.getAttribute("fromDate");		
	}
	if(request.getAttribute("toDate")!=null&&!request.getAttribute("toDate").toString().isEmpty()){
		toDate = (String)request.getAttribute("toDate");		
	}
	NumberFormat nf = NumberFormat.getNumberInstance(Locale.GERMAN);
%>

<jsp:include page="/admin/layouts/header.jsp">
    <jsp:param name="language" value="1" />
</jsp:include>
<script type="text/javascript">
	jQuery(document).ready(function () {
		jQuery(".leftmenu ul li").removeClass("current");
		jQuery(".leftmenu ul li a.emailmarketing").parent().addClass("current");
		
		jQuery("#fromDate, #toDate" ).datepicker();	
	});
	var server = "<%=UrlHelper.getServerUrl(request)%>";
</script>

        <div class="maincontent noright">
        	<div class="maincontentinner">
            	
                <ul class="maintabmenu">
                	<li class="current"><a href="/admin/dashboard">Thống kê Email marketing</a></li>
                </ul><!--maintabmenu-->
                
                <div class="content">                
					<form class="stdform" action="/admin/statistic" method="post">
					<input type="hidden" name="action" value="email_marketing"/>
                    	<div class="one_half">                          	
	                        <p>
	                    		<label>Từ ngày : </label>
	                             <span class="field"><input type="text" name="fromDate" class="longinput" id="fromDate" value="<%=(fromDate!=null&&!fromDate.isEmpty())?fromDate:""%>"/></span>                            
	                    	</p>   
	                    	<p>
	                    		<label>Đến ngày : </label>
	                             <span class="field"><input type="text" name="toDate" class="longinput" id="toDate" value="<%=(toDate!=null&&!toDate.isEmpty())?toDate:""%>"/></span>                            
	                    	</p>                      	
	                    	<p class="stdformbutton">
	                        	<input type="submit" class="reset radius2" value="Tìm kiếm">
	                            <input type="reset" class="reset radius2" value="Làm lại">
	                        </p>                 	     	                    	        	                                         	
                    	</div><!--one_half-->                                                        	                    	       	                        					
                   </form> 
                   <br clear="all" /><br />                	
                	<div class="contenttitle radiusbottom0">
	                	<h2 class="table"><span>Kết quả tìm kiếm</span></h2>
	                </div>	                	           
	                <table cellspacing="0" cellpadding="0" border="0" class="stdtable stdtablecb" id="list-table">	                   
	                    <thead>
	                        <tr>	                        	
	                            <th class="head1">Tổng số Email</th>
	                            <th class="head0">Email đã gửi</th>
	                            <th class="head1">Click</th>
	                            <th class="head0">Mua hàng</th>
	                            <th class="head1">Gía trị đăng ký</th>
	                            <th class="head0">Giá trị đã thanh toán</th>	                                                  
	                        </tr>
	                    </thead>	                   
	                    <tbody>	                    	
	                        <tr>	                        	
								<td class="center"><%=nf.format(0) %></td>
	                            <td class="center"><%=nf.format(0) %></td>
	                            <td class="center"><%=nf.format(clickCount) %></td>
                            	<td class="center"><%=nf.format(orderCount) %></td>
	                          	<td class="center"><%=nf.format(displayMoney) %></td>
                            	<td class="center"><%=nf.format(realMoney) %></td>	                           	                           
	                        </tr>	                      
	                    </tbody>
	                </table>	 
	                        	                	            
                </div><!--content-->                
            </div><!--maincontentinner-->            
            <jsp:include page="/admin/elements/copyright.jsp">
            	<jsp:param name="language" value="1" />
			</jsp:include>            
        </div><!--maincontent-->        
<jsp:include page="/admin/layouts/footer.jsp">
    <jsp:param name="language" value="1" />
</jsp:include>